package cn.fintecher.gis.web;

import cn.fintecher.gis.annotation.CurrentOperator;
import cn.fintecher.gis.model.request.ExpropriationRequest;
import cn.fintecher.gis.model.session.SessionModel;
import cn.fintecher.gis.service.ExpropriationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * @Auther: xiaqun
 * @Description: 征地相关接口
 * @Date: 18:10 2019/4/29
 */

@RestController
@RequestMapping("/api/expropriationController")
@Api(value = "expropriationController", description = "征地相关接口")
public class ExpropriationController extends BaseController {
    @Autowired
    private ExpropriationService expropriationService;

    /**
     * 新增征地信息
     */
    @PostMapping("/addExpropriation")
    @ApiOperation(value = "新增征地信息", notes = "新增征地信息")
    public ResponseEntity<Void> addExpropriation(@RequestBody ExpropriationRequest request,
                                                 @ApiIgnore @CurrentOperator SessionModel operator) throws Exception {
        log.debug("REST request to addExpropriation,{}", request);
        expropriationService.addExpropriation(request, operator);
        return ResponseEntity.ok().build();
    }
}
